HAIKU IMPLEMENTATION#819
Open
yug105 wants to merge 49 commits into
Open
Conversation
This reverts commit e4a4e52.
# Conflicts: # .github/workflows/freebsd-test.yml
Member
|
Let's review this next week. @yug105 meanwhile you can try to implement it in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Build system
tools/metacall-environment.sh+tools/metacall-configure.sh— added Haiku OS detection usinguname -sand the Haiku dependency install step viapkgman:cmake/CompileOptions.cmake— include thebeosOS family in the Unix/macOS compile-options branch so Haiku gets the same hardening/flags treatmentcmake/Portability.cmake— removed/commented out the old_GENERATE_EXPORT_HEADERworkaround that forcedWIN32=1on Haiku; modern CMake export headers work on Haiku without itPlatform
#ifcoverage — Haiku added to existing platform guardssource/format/include/format/format_specifier.h— Haiku has<unistd.h>/ POSIX format macros; without this, format specifiers fell into the unsupported branchsource/metacall/include/metacall/metacall_fork.h+source/metacall/source/metacall_fork.c— Haiku has POSIXfork()/pid_t, so it joins the Unix fork-safety path. This is whatmetacall-fork-testexercises, now passingsource/metacall/source/metacall_link.c— Haiku has<dlfcn.h>, joins the Unixdlsym()hook pathsource/threading/include/threading/threading_mutex.h— Haiku has pthreads; usepthread_mutexlike the BSDssource/portability/include/portability/portability_path.h— Haiku branch definingPORTABILITY_PATH_SIZEasPATH_MAXwith the right headerssource/portability/include/portability/portability_executable_path.h— Haiku typedef for the path-length type (size_t)Haiku-native API corrections
source/threading/source/threading_thread_id.c— two fixes:<kernel/OS.h>, not the BeOS-era<be/kernel/OS.h>find_thread(NULL);thread_get_current_thread_id()is a private/internal function not in Haiku's public headersCI (
haiku-test.yml)New workflow running
debug,relwithdebinfo, andreleaseon a Haiku VM viacross-platform-actionsConfigures
debug_serverwith:On Haiku, a crashing process doesn't die;
debug_serversuspends it waiting for a debugger, so in headless CI every crash looks like an infinite hang.With this setting, crashes terminate immediately and write a crash report with a stack trace, which the workflow dumps into the log.
Missing symbol at load time (
portability/metacallCMakeLists)dl_iterate_phdr()lives in Haiku'slibbsd.so, notlibrootHaiku's
runtime_loaderbinds all symbols eagerly, so any binary touching the portability code aborted at load withB_MISSING_SYMBOL/ exit code4, with no outputLinked
bsdon Haiku in both the portability library and the MetaCall unity builddynlink_impl_beos.c—BIND_SELFload_add_on()never deduplicates: calling it on the running executable loads a second copy of the image and re-runs all its static constructors, matching BeOS replicant semanticsReplaced the
BIND_SELFpath withdlopen(NULL), which on Haiku returns the global scope without loading anything — matching the Unix implementation's semanticsSymbol lookup branches to
dlsym()for the self handleportability_executable_path.cHad no Haiku branch, so
*lengthwas returned uninitializedThis caused an out-of-bounds read in
portability_path_get_name()and a segfault indynlink-testAdded a branch using
get_next_image_info()to find theB_APP_IMAGEpathserial_test.cppAdded
__HAIKU__to the expected pointer-format#ifHaiku's
%pprints0xa7ef2, same as Linuxplthook(plthook_detour/CMakeLists.txt)Haiku support for PLT hooking — fixes
detour-testandmetacall-fork-testCurrently fetches from my fork:
yug105/plthook, branchhaiku-support